#pragma once

#pragma warning(push)
#pragma warning(disable:4251)

#include "CoolUIDefine.h"

#include <map>
using namespace std;

class CUIWindow;
class CUIFrame;

class COOLUI_CLASS CUIHookWindow
{
public:
    CUIHookWindow( void );

    virtual ~CUIHookWindow( void );

    static CUIWindow* FromeHandle( HWND hWnd );

    static BOOL HookWindow( CUIWindow* pWnd );

    static void UnHookWindow( CUIWindow* pWnd );

    static CUIFrame* GetMainFrameWnd();

private:
    static UINT NewWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam );

    static map<HWND, CUIWindow*> m_WindowObjMap;
};

#pragma warning(pop)
